<%-- 
    Document   : Employee
    Created on : May 9, 2012, 9:28:43 AM
    Author     : Thanh Luan
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>
<f:subview id="conf425475">
    <html>
        <head>

            <script type="text/javascript" language="javascript" src="../scripts/jQuery/confirm.js"></script>
            <script type="text/javascript" language="javascript" src="../scripts/jQuery/jq.date.js"></script>  
            <link rel="stylesheet" type="text/css" href="../css/ui.datepicker.css"/>
            <!-- -->
            <link rel="stylesheet" type="text/css" href="../scripts/tabs/slidingtabs-horizontal.css">
            <script type="text/javascript" src="../scripts/tabs/slidetab.js"></script>
            <!-- -->
            <link rel="stylesheet" type="text/css" href="../css/thickbox.css"/>
            <link rel="stylesheet" type="text/css" href="../css/dropdown.css"/>
            <script type="text/javascript" language="javascript" src="../scripts/jQuery/thickbox.js"></script>
            <script type="text/javascript" language="javascript" src="../scripts/jQuery/jquery.rateit.js"></script>
            <script type="text/javascript" language="javascript" src="../scripts/jQuery/easypaginate.js"></script>
            <link rel="stylesheet" type="text/css" href="../css/rateit.css">

            <script type="text/javascript" language="javascript">
                var open_cur = 0;
                $j = jQuery.noConflict();
                $j(document).ready(function(){
                    $j('input#leavedate111').datepicker({ dateFormat: 'dd/mm/yy', showOn: 'button', buttonImage: '../images/calenda_icon.gif', buttonImageOnly: true }); 
                    $j('input#leavedate112').datepicker({ dateFormat: 'dd/mm/yy', showOn: 'button', buttonImage: '../images/calenda_icon.gif', buttonImageOnly: true }); 
                    $j('input#leavedate1a').datepicker({ dateFormat: 'dd/mm/yy', showOn: 'button', buttonImage: '../images/calenda_icon.gif', buttonImageOnly: true }); 
                    $j('input#leavedate1b').datepicker({ dateFormat: 'dd/mm/yy', showOn: 'button', buttonImage: '../images/calenda_icon.gif', buttonImageOnly: true }); 
                    initThickBox('.thickbox');            
                    $j('.keysearch').live('keyup',function(){
                        if($j('.keysearch').val() == ""){
                            $j('.rich-table-row').show();                   
                        }else{
                            $j('.rich-table-row').hide();
                            $j('.rich-table-row').each(function(){
                                html = $j(this).html();
                                if(   ununicode(html).indexOf(  ununicode($j('.keysearch').val()) ) > -1    )  {
                                    $j(this).show();
                                }else{
                                    $j(this).hide();
                                }
                            });
                        }

                    });
                    $j(".checkAll").live("click",function(){
                        flag = $j('.checkAll').is(':checked');

                        $j(".check_select").each(function(){
                            $j('.check_select')  .attr('checked', flag);
                        });


                    });
                    $j(".rich-table-row:odd").addClass("odd");
                    
                    // Begin Event load ajax form CRM
                   
                    $j('.contactN950').live('click',function(){
                        object = $j(this).next();
                        var pn100ED  =$j('.customer-box').attr("lang");                        
                        var pn100KH = $j('#formKHCN\\:pn100').val();                     
                       
                       
                        $j.post("contactCRM.jsp?action=editajaxpage&pn100="+ pn100KH+"&table=N100", function(data){
                            $j('.customer-boxcontact').html(data);
                        });
                         
                        
                    
                    });
                    $j('.acountT025').live('click',function(){
                        object = $j(this).next();
                        var pn100KH = $j('#formKHCN\\:pn100').val();   
                        $j.post("accountCRM.jsp?action=editajaxpage&pn100="+pn100KH+"&tv026=N100",function(data){
                            $j('.customer-boxacount').html(data);
                        }) ;
                    
                    
                    });
                
                    $j('.customerK100').live('click',function(){
                        object = $j(this).next();
                        var pn100KH = $j('#formKHCN\\:pn100').val(); 
                        $j.post("customerdemo.jsp?action=editEmp&pn100="+ pn100KH+"&table=formload&pt025=1&itemid=N100", function(data){
                            $j('.customer-boxcustomer').html(data);
                        });
                    
                    });
                
                    $j('.infoN350').live('click',function(){
                        object = $j(this).next();
                        var pn100KH = $j('#formKHCN\\:pn100').val(); 
                        $j.post("passportCRM.jsp?action=editajaxpage&pn100="+ pn100KH, function(data){
                            $j('.customer-boxN350').html(data);
                        });
                    
                    });
                    $j('.companyCRM').live('click',function(){
                        object = $j(this).next();
                        var pn100KH = $j('#formKHCN\\:pn100').val(); 
                        $j.post("companyCRM.jsp?action=editajaxpage&pn100="+ pn100KH, function(data){
                            $j('.customer-companyCRM').html(data);
                        }) ;
                    
                    }); 
                    
                    // End Event load ajax form CRM for Dashbord
                    // Show hide form customerInputExpand from Customer
                    $j('.header-box').live('click', function(){    
                        $j(".mesage").text("");
                        if($j(this).next('.customer-box').css('display') != 'none'){
                            return;
                        }else{
                            //var PN100=$j('#form-input-customerform\\:PN100').val();
                            var PN100 = $j('#formKHCN\\:pn100').val(); 
                            if(PN100 != 0)
                            {
                                $j('.messa').hide();
                                $j('.customer-box').slideUp();                         
                                $j('.boder-bomttom').removeClass('boder-bomttom');
                                $j(this).next('.customer-box').slideDown();
                                $j(this).addClass('boder-bomttom');
                            } else{                        
                                $j('.messa').show();
                                $j(this).next('.customer-box').css('display') != 'none'
                            }
                           
                        }

                    });
                    $j('.vv031').live('click',function(){
                        $j(this).parents('.group_manager').parents('.item').find('.edit_more').find('.select_hidden').find('.menu-context-tour').trigger('click');
                    });
                    
                    
                    // Lịch sử khách hàng
                    $j('.loadHistory').live('click',function(){
                        dayss = $j(this).attr('lang');
                        window.location.href="customer.jsp?action=reloadfordays&dayss="+dayss;
                        
                    });
                    $j(".closeBirthday").live('click',function(){
                        $j(this).parent().hide();
                    });
                });
            </script>
            <script type="text/javascript" language="javascript">
                var open_cur = 0;
                $j = jQuery.noConflict();
                $j(document).ready(function(){
                    //search client
                    //searchClient();
                   
                    $j('.text_search').live('keyup',function(){
                        if($j('.text_search').val() == ""){
                        
                            $j('.headerdivtable_bootom').show();
                            $j('.close').trigger('click');   
                        }else{
                            $j('.close').trigger('click');
                            $j('.headerdivtable_bootom').hide();
                            $j('.headerdivtable_bootom').each(function(){
                                html = $j(this).html();
                                if(   ununicode(html).indexOf(  ununicode($j('.text_search').val()) ) > -1    )  {
                                    $j(this).show();
                                }else{
                                    $j(this).hide();
                                }
                            });
                        }

                    });
                    //
                    initThickBox('.thickbox');
                    $j('.st_horizontal').slideTabs();
                    Tab4Kapi();
                    $j('a.button.edit').live('click',function() {
                     
                        $j(this).parent("div").parent("div").hide().next("div").show();
                    
                    });
                   
                    $j(".rateit").bind('rated', function (event, value) { 
                        pn100 = $j(this).attr('lang');
                        
                        star_value = value;
                       
                        $j.post("star.jsp?action=favourite&flag=star&ni105="+star_value+'&pn100='+pn100,function(){
                        
                        });
                    });
             
                    $j('.search_boxnew').hide();       
                    $j('.sidebar_search').live('click',function(){
                        $j('.search_boxnew').hide();
                        if($j(this).next().hasClass('active')){

                            $j('.search_boxnew').removeClass('active');
                        }else{

                            $j('.search_boxnew').removeClass('active');
                            $j(this).next().addClass('active');
                            $j(this).next().show();
                        }
                    });
                    $j(".content_right").live("click",function(){
                        $j('.search_boxnew').hide();
                    });
                    //                    $j(".choise_groups").live("click",function(){
                    //                        pn100 = $j(this).attr("lang");
                    //                       
                    //                        $j.post("listGroup.jsp?action=groupCus&pn100="+pn100,function(data){
                    //                            if(data!=null) {
                    //                                $j(".group_list_cus").html(data);
                    //                                                       
                    //                            }
                    //                        });  
                    //                    });
                    //save column V030
                    $j(".updateV500").live("click",function(){
                        pn100 = $j(this).parent(".group_list_cus_tour").attr('lang');
                        pv050 = $j(this).attr('lang');
                        vv031 = $j(this).text();
                      
                        $j.post('v030Begin.jsp?action=updateV030&pn100='+pn100+'&pv050='+pv050+'&vv031='+vv031,function(data){
                            if(data!= null){
                                hidePleaseWait(); 
                                window.location.href="customer.jsp";
                            }
                        });
                        
                        
                    });
                    $j(".updateq400").live("click",function(){
                        pn100 = $j(this).parent(".group_list_cus").attr('lang');
                       
                        pk400 = $j(this).attr('lang');
                        kv401 = $j(this).text();
                        showPleaseWait();
         
                        $j.post('k400Begin.jsp?action=updateK400N&pn100='+pn100+'&pk400='+pk400+'&kv401='+kv401,function(data){
                            if(data!= null){
                                hidePleaseWait(); 
                            }
                        });
                    
                    });
                
                    $j(".showdatafor").live("click",function(){
               
                        $j(this).next().css('display','block'); 
                    });
                    $j(".clickShow").live("click",function(){
                        $j(this).parent().parent().css('display','none');
                    });
                    $j( ".sendSMS_person" ).click(function() {
                        $j( "#togglesms" ).show();
                        $j( "#togglesms" ).animate({height:'auto',opacity:'0.9'},"slow");
                        $j( "#togglesms" ).animate({width:'39%',opacity:'0.9'},"slow");
                        var info = $j(this).attr('lang');
                        $j.post("SgtSMS.jsp?"+info,function(data){
                            if(data!=null){
                                $j( "#togglesms" ).html(data);
                            }
                        });
                    });
                          $j('.find_all_emp').live('click',function(){
                    showPleaseWait();
                    keyserch=$j(this).parent().prev().prev().val();
                  
                    hidePleaseWait();
                    window.location="customer.jsp?action=functionSearch&keysearch="+keyserch+"&typesearch=0&pagename=ALL";
                    hidePleaseWait();
                  
                });
                });
            </script>

        </head>
        <body>
            <div id="togglesms">

            </div>
            <a4j:form>
                <f:loadBundle basename="#{environmentSession.localizationSource}" var="locale"/>
                <h:outputText value="<div class='permission' lang='#{loginSession.right.MENU_CUS_VIEW}'></div>" escape="false"/>
                <div id="content">
                    <div id="menutop_top">
                        <div class="div_search_menutop">
                            <div class="item_search">
                                <h:inputText onfocus="if(this.value=='search') this.value='';" style="float:left;" styleClass="text_search" value="#{CustomerBean.keySearch}"/>
                                <div style="float:left;border-top: 1px solid #55ACDB;border-bottom: 1px solid #55ACDB;" class="img_search"> <h:graphicImage style="float:left;" value="../images1/arrow_down.png"/></div>
                                <div style="float:left;border: 1px solid #55ACDB;"> <h:graphicImage styleClass="find_all_emp" style="float:left;" value="../images1/btn_search.png"/></div>
                            </div>
                            <div class="form_search_header">
                                <div class="item_search "><h:outputText value="x" styleClass="close_search" style="font-weight:bold;float:right;margin-right:2.2%;"/></div>
                                <div class="item_search">
                                    <table id="table_search">
                                        <tr>
                                            <td class="celltable">
                                                <h:selectOneRadio styleClass="css_radio" value="#{CustomerBean.typeSearch}">
                                                    <f:selectItem itemValue="1" itemLabel="Công ty" />

                                                    <f:selectItem itemValue="2" itemLabel="Phone" />
                                                    <f:selectItem itemValue="3" itemLabel="Họ tên" />
                                                    <f:selectItem itemValue="4" itemLabel="CMND" />
                                                    <f:selectItem itemValue="5" itemLabel="Email" />
                                                    <f:selectItem itemValue="6" itemLabel="MSKH" />

                                                </h:selectOneRadio>
                                            </td>

                                        </tr>
                                        <tr>
                                            <td class="celltable">
                                                <h:commandButton actionListener="#{CustomerBean.reload}" value="#{locale.search}" styleClass="buttonsearch">
                                    </h:commandButton>
                                            </td>

                                        </tr>
                                    </table>

                                </div>
                            </div>
                        </div>

                        <div class="icon_action">
                            <h:outputLink  rendered="#{loginSession.right.CUS_LST_CRE }" value="customerInputExpand.jsp?action=addEmp&flagform=2&table=A&close=1&height=300px&width=400px" styleClass="fancybox add_new" id="fancybox">
                                <h:graphicImage title="Thêm khách hàng" value="../images1/add_per.png"/>
                            </h:outputLink>



                        </div>

                        <div class="icon_action">

                            <div class="classimageSMS">
                                <img src="../images1/sms.png" class="sendSMS_person" lang="page=sendSMSitemEmployee" title="Xác nhận  SMS"/>
                            </div>

                        </div>
                      

                        <div class="icon_action">
                            <h:commandButton rendered="#{loginSession.right.EMP_LST_EXC}" style="margin-left:0px;" actionListener="#{EmpBean.exportExcel()}"  
                                             onclick="showPleaseWait();"                                   
                                             styleClass="buttonExcel" >                

                            </h:commandButton>

                        </div>

                        <div class="icon_action">
                            <h:outputLink  value="popUpSendEmail.jsp?page=employee&step=9&fk100reload=0&KeepThis=true&amp;TB_iframe=true&amp;height=653&amp;width=741&amp;modal=true" styleClass="thickbox add_new abc" id="thickbox15"  >
                                <h:graphicImage value="../images1/email.png" title="Send mail"/>
                            </h:outputLink>


                        </div>

                    </div>
                    <div id="menutop">
                        <div class="dropdown">
                            <div class="select_choise">
                                <a href="#"><span>Khu vực</span></a>
                            </div>
                            <div class="select_hidden">
                                <ul>

                                    <li><a href="#"><span>Filter Cấp 3</span></a></li>
                                    <li><a href="#"><span>Filter Cấp 3</span></a></li>
                                </ul>
                            </div>

                        </div>
                        <h:panelGroup rendered="#{loginSession.right.DAB_LST_PAR}">
                            <div class="dropdown">
                                <div class="select_choise">
                                    <a href="#">
                                        <span class="department2" lang="<h:outputText value="#{n450_n850.fn850}"/>">
                                            <h:outputText rendered="#{n450_n850.fn850 !=0}" value="#{n450_n850.nv851}"/>
                                            <h:outputText rendered="#{n450_n850.fn850 ==0}" value="Tất cả"/>
                                        </span>
                                    </a>

                                </div>
                                <div class="select_hidden departmentlistN850">

                                    <ul>
                                        <li><a href="#"><span class="department3" lang="<h:outputText value="0"/>">
                                                    <h:outputText value="Tất cả"/>
                                                </span></a></li>                          


                                        <a4j:repeat value="#{n450_n850.listComb850}" var="item">
                                            <li><a href="#"><span class="department2" lang="<h:outputText value="#{item.value}"/>">
                                                        <h:outputText value="#{item.label}"/>
                                                    </span></a></li> 
                                                </a4j:repeat>
                                    </ul>
                                </div>
                            </div>
                        </h:panelGroup>
                        <h:panelGroup rendered="#{loginSession.right.CUS_LST_PAR}">

                            <h:inputHidden value="#{CustomerBean.loginEmp}"/>

                            <h:selectOneMenu  value="#{CustomerBean.loginEmp}" style="height:25px;width:15%;" styleClass="cbx_editEmp" id="ckb_098">
                                <f:selectItems value="#{CustomerBean.lstEmpByID}" />
                                <a4j:support event="onchange"  reRender="reloadcustomer" onsubmit="showPleaseWait();" oncomplete="hidePleaseWait();"  actionListener="#{CustomerBean.reloadlist}"> 

                                </a4j:support>
                            </h:selectOneMenu>


                        </h:panelGroup>
                        <h:panelGroup rendered="#{CustomerBean.ni104 == 1}">
                            <div class="dropdown" style="float: right;">
                                <div class="select_choise">
                                    <a href=""><span><h:outputText value="#{locale.normal_customer}"/></span></a>
                                </div>
                                <div class="select_hidden">
                                    <ul>

                                        <h:panelGroup rendered="#{loginSession.right.CUS_LST_NOR}">
                                            <li>
                                                <a href="customer.jsp?type=0"><span><h:outputText value="#{locale.hiddencustomer}"/></span></a>
                                            </li>
                                        </h:panelGroup>

                                    </ul>
                                </div>
                            </div>
                        </h:panelGroup>
                        <h:panelGroup rendered="#{CustomerBean.ni104 == 0}">
                            <div class="dropdown" style="float: right;">
                                <div class="select_choise">
                                    <a href=""><span><h:outputText value="#{locale.hiddencustomer}"/></span></a>
                                </div>
                                <div class="select_hidden">
                                    <ul>

                                        <h:panelGroup rendered="#{loginSession.right.CUS_LST_NOR}">
                                            <li>
                                                <a href="customer.jsp?type=1"><span><h:outputText value="#{locale.normal_customer}"/></span></a>
                                            </li>
                                        </h:panelGroup>

                                    </ul>
                                </div>
                            </div>
                        </h:panelGroup>
                    </div>

                    <%--    <div class="fillter">
                            <div class="dropdown">
                                <h:panelGroup id="reload5">
                                    <h:panelGroup  rendered="#{EmpBean.fk400 > 0}" >
                                        <div class="select_choise ">

                                        <a href="#"><span><h:outputText value="Action"/></span></a>


                                    </div>
                                    <div class="select_hidden">
                                        <ul>

                                            <li>
                                                <h:outputLink rendered="#{EmpBean.fk400 > 0}" value="addgroupcustomer.jsp?action=loadGroup&page=employeenew.jsp&pk400=#{EmpBean.fk400}&kv451=N100E&KeepThis=true&amp;TB_iframe=true&amp;height=453&amp;width=941&amp;modal=true" styleClass="thickbox add_new" id="thickbox2"  >
                                                    <span> <h:outputText value="#{locale.add_group}"/></span>
                                                </h:outputLink>
                                            </li>
                                            <li >
                                                <h:outputLink rendered="#{EmpBean.fk400 > 0}" value="removegroupcustomer.jsp?action=loadGroup&page=employeenew.jsp&pk400=#{EmpBean.fk400}&kv451=N100E&KeepThis=true&amp;TB_iframe=true&amp;height=425&amp;width=952&amp;modal=true" styleClass="thickbox add_new" id="thickbox3"  >
                                                    <span> <h:outputText value="#{locale.delete_group}"/></span>
                                                </h:outputLink>

                                            </li>


                                        </ul>
                                    </div>
                                </h:panelGroup>
                            </h:panelGroup>
                        </div>
                    </div> --%>

                    <div style="width: 100%;float: left;height: 67%;overflow: auto;">
                        <div class="headerdivtable">
                            <div class="itemheaderdivtable_center" style="width: 2%;">
                                <h:outputText value="STT"/>
                            </div>
                            <div class="itemheaderdivtable_center" style="width: 9%;">
                                <h:outputText value="ACTION"/>
                            </div>
                            <div class="itemheaderdivtable_center" style="width: 1%;">
                                <h:selectBooleanCheckbox styleClass="checkAll" value=""/>
                            </div>
                            <div class="itemheaderdivtable_center" style="width: 12%;">
                                <h:outputText value="HỌ TÊN" />
                            </div>
                            <%--  <div class="itemheaderdivtable_center" style="width: 6%;">
                                  <h:outputText value="XÉT DUYỆT"/>
                              </div> --%>
                            <div class="itemheaderdivtable_center" style="width: 10%;">
                                <h:outputText value="COMPANY"/>
                            </div>
                            <div class="itemheaderdivtable_center" style="width: 3%;">
                                <h:outputText value="SEX"/>
                            </div>
                            <div class="itemheaderdivtable_center" style="width: 6%;">
                                <h:outputText value="PHONE"/>
                            </div>
                            <div class="itemheaderdivtable_center" style="width: 15%;">
                                <h:outputText value="EMAIL"/>
                            </div>

                            <div class="itemheaderdivtable_center" style="width: 6%;">
                                <h:outputText value="RATING" />
                            </div>
                            <div class="itemheaderdivtable_center" style="width: 4%;">
                                <h:outputText value="TOUR"/>
                            </div>
                            <div class="itemheaderdivtable_center" style="width: 9%;">
                                <h:outputText value="PERSONAL"/>
                            </div>
                            <div class="itemheaderdivtable_center" style="width: 18.7%;">
                                <h:outputText value="NOTE"/>
                            </div>


                        </div>

                        <div class="headerdivtable_over">
                            <a4j:repeat  value="#{CustomerBean.listCustomer}" var="item" rowKeyVar="index">    
                                <div class="noteRow headerdivtable_bootom <h:outputText rendered="#{index%2 !=0}"  value="headerdivtable_tr"/>">
                                    <div class="itemheaderdivtable_center " style="width: 2%;color:#0055A6;">
                                        <h:outputText value="#{index+CustomerBean.offset+1}" >
                                            <f:convertNumber  pattern="##000"></f:convertNumber>
                                        </h:outputText>
                                    </div>
                                    <div class="itemheaderdivtable_center" style="width:9%;">
                                        <h:outputLink style="float:left;margin-right: 1px;"  value="workChargeDashInput.jsp?action=addDash&pn100=#{item.pn100}&fk100=#{item.fk100}&page=customer.jsp&height=300px&width=500px" styleClass="fancybox">
                                            <img src="../images/workcharge.png" alt="CH" title="Chăm sóc khách hàng" style="padding-right:4px;"/>
                                        </h:outputLink>
                                        <h:outputLink style="float:left;margin-right: 1px;"  rendered="#{loginSession.right.CUS_LST_MOD}"  value="customerInputExpand.jsp?action=editEmp&flagform=2&pn100=#{item.pn100}&table=A&ni104=#{item.ni104}&height=300px&width=400px" styleClass="fancybox">
                                            <img title="edit" alt="edit" src="../images/edit.png">
                                            <f:param value="#{item.pn100}" name="pn100"></f:param>
                                        </h:outputLink>
                                        <h:outputLink style="float:left;margin-right: 1px;"  rendered="#{loginSession.right.CUS_LST_DEL}"  value="deleteCustomer.jsp?action=delete&pn100=#{item.pn100}&table=A&height=300px&width=400px" styleClass="fancybox add_new" id="fancyboxd">
                                            <img src="../images/delete_1.png" alt="delete"  title="delete" />
                                        </h:outputLink>
                                        <h:outputLink style="float:left;margin-right: 1px;" value="note.jsp?action=addnote&pn100=#{item.pn100}&height=300px&width=400px" styleClass="fancybox">
                                            <img src="../images/add_tab.png" title="Cập nhật ghi chú"/>
                                        </h:outputLink>
                                        <h:panelGroup rendered="#{loginSession.right.CUS_LST_TOR}">
                                            <div class="select_group " style="margin-right: 1px;margin-left: 0px;">
                                                <h:outputLink value="listTour.jsp?action=addPTour&flagaddTour=noList&pn100=#{item.pn100}" style="margin-left:-11px;">
                                                    <div class="choise_groups_tour" lang="<h:outputText value="#{item.pn100}"/>">

                                                    </div> 
                                                </h:outputLink>
                                            </div>
                                        </h:panelGroup>
                                      <%--  <h:panelGroup rendered="#{loginSession.right.CUS_LST_UPB}">
                                            <div class="select_group " style="margin-right: 1px;margin-left: 0px;">
                                                <div class="choise_groups" lang="<h:outputText value="#{item.pn100}"/>"></div>
                                                <div class="choise_groups_hiden">
                                                    <div class="group_header"><h:outputText value="Nhóm"/></div>
                                                    <div class="group_list_cus" lang="<h:outputText value="#{item.pn100}"/>">
                                                        <a4j:repeat value="#{CustomerBean.listQ400Filter}" var="q400">
                                                            <h:outputText value="#{q400.label}" styleClass="updateq400"  lang="#{q400.val}"/>  
                                                        </a4j:repeat>
                                                    </div>
                                                </div>
                                            </div>
                                        </h:panelGroup>--%>
                                    </div>
                                    <div class="itemheaderdivtable_center" style="width: 1%;">
                                        <h:selectBooleanCheckbox style="margin-left:0px" styleClass="checkAll" value=""/>
                                    </div>
                                    <div class="itemheaderdivtable_left graphic" style="width: 12%;">
                                        <h:outputText styleClass="itemcontent itemcontent#{item.pn100}" rendered="#{item.nv130!=null}" style="color:#0055A6;font-weight:bold;" title="#{item.nv130}" value="#{item.hoten}(#{item.old})" lang="#{item.pn100}"/>
                                        <h:outputText styleClass="itemcontent itemcontent#{item.pn100}" rendered="#{item.nv130==null}" value="#{item.hoten}(#{item.old})" lang="#{item.pn100}"/>
                                    </div>

                                    <div class="itemheaderdivtable_left" style="width: 10%;">
                                        <h:outputLink rendered="#{item.kv103!=null}" value="cuscompany.jsp?action=linkCom&pnPK100=#{item.fk100}&type=#{item.kn114}"><h:outputText  value="#{item.subKv103}" title="#{item.kv103}"/></h:outputLink> 
                                        <h:outputText rendered="#{item.kv103==null}" value=""/>
                                    </div>
                                    <div class="itemheaderdivtable_center" style="width: 3%;">
                                        <h:outputText value="#{item.nv107}" />
                                    </div>
                                    <div class="itemheaderdivtable_center" style="width: 6%;">
                                        <a style="padding-left: 5px;font-style: italic;" href="sendSMS.jsp?action=sendSMS&page=customer.jsp&pk400=<h:outputText value='#{CustomerBean.groupID}'/>&dayss=<h:outputText value='#{CustomerBean.dayss}'/>&type=<h:outputText value='#{CustomerBean.ni104}'/>&redirect=customer&hoten=<h:outputText value='#{item.hoten}'/>&pn100=<h:outputText value='#{item.pn100}'/>&phone=<h:outputText value="#{item.nv958}"/>" class="fancybox actionsendsms" lang="<h:outputText value="#{item.nv958}"/>"> <h:outputText value="#{item.nv958}" styleClass="phone" lang="#{item.nv958}"/> </a>
                                    </div>
                                    <div class="itemheaderdivtable_left " style="width: 15%;">
                                        <h:outputLink style="padding-left: 5px;font-style: italic;" value="popupSendMailPerson.jsp?page=customer&idx=#{item.pn100}&mailx=#{item.nv967}&typex=customer&KeepThis=true&amp;TB_iframe=true&amp;height=653&amp;width=741&amp;modal=true" styleClass="thickbox add_new" id="thickbox33"  ><h:outputText value="#{item.nv967}" /></h:outputLink>
                                    </div>
                                    <div class="itemheaderdivtable_left " style="width: 6%;">
                                        <h:panelGroup rendered="#{loginSession.right.CUS_LST_FEB}">
                                            <div class="rating_star">
                                                <div class="rateit" lang="<h:outputText value='#{item.pn100}'/>" id="<h:outputText value='#{item.pn100}'/>" data-rateit-min="0" data-rateit-value="<h:outputText value='#{item.ni105}'/>"></div>

                                            </div>
                                        </h:panelGroup>
                                    </div>

                                    <div class="itemheaderdivtable_center " style="width: 4%;">
                                        <h:outputText style="color:red;font-weight:bold;" value="#{item.vv031}"/>
                                    </div>
                                    <div  class="itemheaderdivtable_left " style="width: 9%;">
                                        <h:outputLink  style="float:left;"  rendered="#{loginSession.right.CUS_PER_MOD}"    value="changeperson.jsp?id=#{item.pn100}&fn850=#{item.fn850}&qv101=#{item.nv113}&flag=N100&page=customer.jsp&height=150px&width=300px" styleClass="fancybox add_new" id="fancyboxff">                                                          
                                            <img  src="../images/icon7.png" alt="edit" title="edit" class="imggroup"/>

                                        </h:outputLink>
                                        <h:outputLink style="float:left;" value="popupSendMailPerson.jsp?page=employee&idx=-1&mailx=#{item.tnhiem}&typex=employee&KeepThis=true&amp;TB_iframe=true&amp;height=653&amp;width=741&amp;modal=true" styleClass="thickbox add_new" id="thickbox13"  >
                                            <h:outputText value="#{item.tnhiemst}" style="float:left;margin-left:5px;"/>
                                        </h:outputLink>
                                    </div>
                                    <div  class="itemheaderdivtable_left " style="width: 18.7%;">

                                        <h:outputText rendered="#{item.nv130!=null}" value="#{item.subNv130}" title="#{item.nv130}"/>
                                        <h:outputText rendered="#{item.nv130==null}" value="&nbsp" escape="false"/>
                                        <h:outputText rendered="#{item.nv130==''}" value="&nbsp" escape="false"/>
                                    </div>
                                    <!--                                    <div  class="itemheaderdivtable_left " style="width: 13.9%;font-size: 8px;">
                                    
                                    
                                                                        </div>-->



                                </div>
                                <div class="noteContent">

                                </div>
                            </a4j:repeat>
                        </div>
                    </div>

                    <rich:modalPanel id="ajaxLoadingModalBox" minHeight="30" minWidth="40"
                                     height="30" width="40" zindex="2000">
                        <h:outputText value="#{locale.please_wait}" styleClass="startDummer"></h:outputText>
                    </rich:modalPanel>

                    <div class="fotter-page">
                        <jsp:include page="../../common/paging.jsp"/>
                    </div>

                </div>

            </a4j:form>
        </body>

    </html>
</f:subview>
<script type="text/javascript" language="javascript">
    var open_cur = 0;
    $j = jQuery.noConflict();
    // tim kiem bang enter
    //    function enterpressalert(e, textarea){
    //var code = (e.keyCode ? e.keyCode : e.which);
    //if(code == 13) { //Enter keycode
    // alert('enter press');
    //}
    //}
    $j(document).ready(function(){

        $j('.itemcontent').live('click',function(){
            showPleaseWait(); 
            pn100 = $j(this).attr('lang'); 
                   
            $j('.noteContent').slideUp();
            $j('.noteContent').html(''); 
            var debt = $j(this).parent().parent().next(); 
            if(debt.hasClass('active')){
                debt.removeClass('active');
            }else{                                               
                debt.removeClass('active');
                debt.addClass('active');                                               
                $j.post('itemCustomernew.jsp?action=getitemvaluePn100&pn100='+pn100,function(data){                      
                    if(data !=null){
                        hidePleaseWait();       
                        debt.html(data);
                      
                        debt.slideDown();
                    }
                });                    
            }
        });
        slide = gup( 'tab' );
        if(slide != null && slide !=undefined && slide.length > 0){
            $j('.'+slide).trigger('click') ;
        }
        $j(".department2").live("click",function(){
                    
            fh200 = $j(".donvi").attr("lang");
            fn850 = $j(this).attr("lang");
            fn450 = $j(".department1").attr("lang");
            showPleaseWait(); 
            $j.post("N450_N850.jsp?&action=group&fh200="+fh200+"&fn450="+fn450 +"&fn850="+fn850,function(data){
                if(data!=null){ 
                    window.location.href="customer.jsp?action=reloadfordays&dayss="+0+"&flagFN850=10";
                    hidePleaseWait();        
                }
            }); 
        });
                
        $j(".department3").live("click",function(){
                     
            fh200 = $j(".donvi").attr("lang");
            fn850 = $j(this).attr("lang");
            fn450 = $j(".department1").attr("lang");
            showPleaseWait(); 
            $j.post("N450_N850.jsp?&action=group&fh200="+fh200+"&fn450="+fn450 +"&fn850="+fn850+"&emp=null",function(data){
                if(data!=null){ 
                    window.location.href="customer.jsp?action=reloadfordays&dayss="+0+"&flagFN850=10";
                    hidePleaseWait();        
                }
            }); 
        });
        
    });
</script>
<style>
    .choise_groups_tour {
        background: url("../images1/plane.png") no-repeat scroll 0 0 transparent;
        float: left;
        margin-top: 5px;
        height: 16px;
        width: 26px;
    }
    .header-box{
        margin-left:25px;
        color:#263340;
        margin-top:10px;
        float: left;
        cursor:pointer;
        padding:4px 0px 0px 4px; 
        width:600px;
        border:1px solid #CCCCCC;
        font-size:12px;
        background: #D4D7D8;
        height: 21px;
        font-weight: bold;
    }
    .customer-box{
        float:left; width:604px; margin-left:25px;
        border:1px solid #CCCCCC;
        padding:18px 0px 10px 0px;
        background: #E5E8EA;
        border-top: none;

    }
    .customer-box label{
        width:90px;
        text-align: right;
        float:left;
    }

    .choise_groups {
        background: url("../images1/group.png") no-repeat scroll 0 0 transparent;
        float: left;
        margin-top: 5px;
        height: 16px;
        width: 26px;
    }
    .select_group{
        width: 16px;;
    }
</style>